{* Smarty *}
{*
 *  This file is part of Urd.
 *
 *  Urd is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  Urd is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. See the file "COPYING". If it does not
 *  exist, see <http://www.gnu.org/licenses/>.
 *
 * $LastChangedDate: 2008-07-03 22:46:29 +0200 (Thu, 03 Jul 2008) $
 * $Rev: 1265 $
 * $Author: gavinspearhead $
 * $Id: admin_users.tpl 1265 2008-07-03 20:46:29Z gavinspearhead $
 *}

<input type="hidden" name="order" id="order" value="{$order}"/>
<input type="hidden" name="order_dir" id="order_dir" value="{$order_dir}"/>

<div><input type="hidden" name="challenge" id="challenge" value="{$challenge}"/></div>
<table class="articles" width="95%">
<tr class="head">
<th onclick="javascript:submit_search_users('name', 'asc');" class="cursor_hand">{$LN_users_username}</th>
<th onclick="javascript:submit_search_users('fullname', 'asc');" class="cursor_hand">{$LN_users_fullname}</th>
<th onclick="javascript:submit_search_users('email', 'asc');" class="cursor_hand">{$LN_users_email}</th>
<th onclick="javascript:submit_search_users('last_active', 'asc');" class="cursor_hand">{$LN_users_last_active}</th>
<th onclick="javascript:submit_search_users('isadmin', 'asc');" class="cursor_hand right">{$LN_users_isadmin}</th>
<th onclick="javascript:submit_search_users('rights', 'asc');" class="cursor_hand right">{$LN_users_rights}</th>
<th onclick="javascript:submit_search_users('post', 'asc');" class="cursor_hand right">{$LN_users_post}</th>
<th onclick="javascript:submit_search_users('active', 'asc');" class="cursor_hand right">{$LN_users_active}</th>
<th>{$LN_users_actions}</th>
</tr>
{section name=x loop=$users}
<tr class="{cycle values="even,odd" name="cycle1"}">
	<td {popup text=$users[x]->username|escape:javascript }>{$users[x]->username|escape:htmlall|truncate:$maxstrlen}</td>
	<td {popup text=$users[x]->fullname|escape:javascript }>{$users[x]->fullname|escape:htmlall|truncate:$maxstrlen}</td>
	<td {popup text=$users[x]->email|escape:javascript }>{$users[x]->email|escape:htmlall|truncate:$maxstrlen}</td>
	<td>{$users[x]->last_active|capitalize|escape}</td>
	<td class="right">{if $users[x]->admin eq $USER_ADMIN}
		<img src="{$IMGDIR}/read.png" alt="{$LN_users_active}" class="noborder" {popup text=$LN_users_isadmin|escape} />
	{else}
		<img src="{$IMGDIR}/empty.png" alt="" class="noborder"/>
	{/if}</td>
	<td class="right">
	{if $users[x]->rights.c == 1}
		<img src="{$IMGDIR}/read.png" alt="{$LN_users_active}" class="noborder" {popup text=$LN_users_rights_help|escape}/>
	{else}
		<img src="{$IMGDIR}/empty.png" alt="" class="noborder"/>
	{/if}
	</td>
	<td class="right">
    {if $users[x]->rights.p == 1}
		<img src="{$IMGDIR}/read.png" alt="{$LN_users_post}" class="noborder" {popup text=$LN_users_post_help|escape}/>
	{else}
		<img src="{$IMGDIR}/empty.png" alt="" class="noborder"/>
	{/if}

	</td>
	<td class="right">
	{if $users[x]->active eq $USER_ACTIVE} 
		<img src="{$IMGDIR}/read.png" alt="{$LN_users_active}" class="noborder" {popup text=$LN_users_active|escape} />
	{else}
		<img src="{$IMGDIR}/empty.png" alt="" class="noborder"/>
	{/if}
	</td>
	<td>
	<img src="{$IMGDIR}/icon_edit.png" alt="{$LN_users_edit}" {popup text=$LN_users_edit|escape } class="noborder" onclick="javascript:user_action('edit',{$users[x]->id});"/>
	{if $emailallowed neq 0} 
		<img src="{$IMGDIR}/icon_mail.png" {popup text=$LN_users_resetpw|escape } alt="{$LN_users_resetpw}" class="noborder" onclick="javascript:user_action('resetpw',{$users[x]->id});" />
	{/if}
	<img src="{$IMGDIR}/icon_delete.png" alt="{$LN_users_delete}" {popup text=$LN_users_delete|escape } class="noborder" onclick="javascript:user_action_confirm('delete',{$users[x]->id}, '{$LN_delete} {$users[x]->username|escape}?');" />
	</td>
</tr>
{/section}
</table>
